<%--

    Document   : nhatkyht
    Created on : Oct 30, 2011, 12:34:35 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT, Beans.NhanVien, Models.ThamSoHT_Model, Models.NhanVien_Model,  Models.PhieuDatMA_Model, Models.Ban_Model"%>
<%
            NhanVien nv = new NhanVien();
            if (session.getAttribute("nv") == null) {
                response.sendRedirect("index.jsp");
                return;
            } else {
                nv = (NhanVien) session.getAttribute("nv");
                if (nv == null || nv.getMaNNV() != 3) {
                    response.sendRedirect("index.jsp");
                    return;
                }
            }
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>i-Order</title>
        <link rel="icon" href="images/icon.png" />
        <link rel="shortcut icon" href="images/icon.png" />
        <link rel="apple-touch-icon" href="images/icon.png"/>
        <link rel="apple-touch-icon-precomposed" href="images/icon.png"/>
        <link href="css/style.css" type="text/css" rel="stylesheet" />
        <link href="css/ui-darkness/jquery-ui-1.8.16.custom.css" type="text/css" rel="stylesheet" />
        <link href="css/jquery.alerts.css" type="text/css" rel="stylesheet" />
        <script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
        <script src="js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
        <script src="js/jquery.ui.datepicker-vi.js" type="text/javascript"></script>
        <script src="js/jquery.ui.datepicker-fr.js" type="text/javascript"></script>
        <script src="js/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
        <script src="js/jquery.alerts.js" type="text/javascript"></script>
        <script src="js/msg.js" type="text/javascript"></script>
        <script src="js/ajax.js" type="text/javascript"></script>
        <title>JSP Page</title>
        <script type="text/javascript">
            $().ready(function() {
                $(".toggle").click(function(){
                    $(".content").slideToggle("medium");
                });
                $('dt a').click(function(){
                    $('dt.current').removeClass('current');
                    $(this).parent().addClass('current');
                });
            });
        </script>
        <script type="text/javascript">
            jQuery(document).ready(function() {
                var Notifi;
                var idd;
                clearInterval(Notifi);
                Notifi = null;
                if(idd == null){
                    idd = setInterval( "Orderbill1()", 3000 );
                }
            });
        </script>
        <script type="text/javascript">
            function keypress(e){
                //Hàm dùng để ngăn người dùng nhập các ký tự khác ký tự số vào TextBox
                var keypressed = null;
                if (window.event)
                {
                    keypressed = window.event.keyCode; //IE
                }
                else
                {
                    keypressed = e.which; //NON-IE, Standard
                }
                if (keypressed < 48 || keypressed > 57 )
                { //CharCode của 0 là 48 (Theo bảng mã ASCII)
                    //CharCode của 9 là 57 (Theo bảng mã ASCII)
                    if (keypressed == 8 || keypressed == 127 || keypressed == 44 || keypressed == 46 )
                    {//Phím Delete và Phím Back
                        return;
                    }
                    return false;
                }
            }
        </script>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'orderbill', 'reservation', 'msgpass', 'msgdetailuser', 'checksubmitmsg', 'save', 'signout', 'phonenumber', 'address', 'newpass', 'nameofuser', 'account', 'hello',  'notice', 'rightmsg' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.
            String account = mdsts[0].getTenTS();
            String address = mdsts[1].getTenTS();
            String checksubmitmsg = mdsts[2].getTenTS();
            String hello = mdsts[3].getTenTS();
            String msgdetailuser = mdsts[4].getTenTS();
            String msgpass = mdsts[5].getTenTS();
            String nameofuser = mdsts[6].getTenTS();
            String newpass = mdsts[7].getTenTS();
            String notice = mdsts[8].getTenTS();
            String orderbill = mdsts[9].getTenTS();
            String phonenumber = mdsts[10].getTenTS();
            String reservation = mdsts[11].getTenTS();
            String rightmsg = mdsts[12].getTenTS();
            String save = mdsts[13].getTenTS();
            String signout = mdsts[14].getTenTS();

            String msgright = notice + "/" + rightmsg;
            String msgchecksubmit = notice + "/" + checksubmitmsg;
            String detailusermsg = notice + "/" + msgdetailuser;
            String passmsg = notice + "/" + msgpass;
            Vector v = (Vector) request.getAttribute("DSBan");

%>
<script type="text/javascript">
    $(function(){
        $('#datepicker1').datepicker($.datepicker.regional['vi']);
        $( "#datepicker1" ).datepicker( "option", "dateFormat","dd/mm/yy");
        $('#datepicker2').datepicker($.datepicker.regional['vi']);
        $( "#datepicker2" ).datepicker( "option", "dateFormat","dd/mm/yy");
    });
</script>

</head>
<body>
        <div id="head">
            <div class="left">
                <a class="button profile" href="">
                    <img style=" margin-top: 4px;" alt="" src="images/huser.png">
                </a>
                <%=hello %>
                <a href="#"><%=nv.getHoTen()%></a>
            </div>
            <div class="userNav">
                <ul>
                    <li>
                        <a href="#" onclick="ShowChangePass()">
                            <img alt="" src="images/settings.png"><span><%=account%></span>
                        </a>
                        <div id="changepass" style="width: 355px; margin-top: 41px; margin-left: -130px !important; background: url('images/topNav.jpg') repeat; ">
                            <form action="" id="changepasss">
                            <div style=" margin: 10px 10px 8px;">
                                <div style=" width: 120px; float: left; font-size: 13px; padding-left: 5px;"><%=nameofuser%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text tennv" name="tennv" value="<%=NhanVien_Model.LayTenNV(nv.getMaNV()) %>" >
                            </div>
                            <div style=" margin: 10px 10px 8px; clear: both;">
                                <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=newpass%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text newpass" name="newpass" >
                            </div>
                            <div style=" margin: 10px 10px 8px; clear: both;">
                                <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=address%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text diachi" name="diachi" value="<%=NhanVien_Model.LayDiaChi(nv.getMaNV()) %>">
                            </div>
                            <div style=" margin: 10px 10px 8px; clear: both;">
                                <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=phonenumber%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text sodt" name="sodt" onkeypress="return keypress(event)" value="<%=NhanVien_Model.LaySoDT(nv.getMaNV()) %> " >
                            </div>
                                <input style=" margin-left: 135px; margin-bottom: 10px; margin-top: 10px;" class="button" type="button"  value="<%=save%>" lang="<%=passmsg%>" alt="<%=msgchecksubmit%>" id="<%=detailusermsg%>" onclick="Changepass1(this.lang, this.alt, this.id)">
                            </form>
                        </div>
                    </li>
                    <li>
                        <a href="DangNhap_Controller?action=logout">
                            <img alt="" src="images/lgout.png"><span><%=signout%></span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="sidebar">
            <dl>
                <dt id="notification">
                    <img alt="" src="images/notification.png">
                </dt>
                <dt class="reservation"><a href="DatBan_Controller?action=Show&item=1" class="1" name="<%=msgright%>"><span><%=reservation%></span></a></dt>
                <dt class="orderbill current"><a href="PhieuDatMA_Controller?action=Show&item=1" class="1" name="<%=msgright%>" onclick="Orderbill( this.className, this.name);"><span><%=orderbill%></span></a></dt>
            </dl>
        </div>
        <div id="content" class="white">
            <div id="DSBanTT" class="bloc" style=" margin-top: 60px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; -o-border-radius: 5px 5px 5px 5px; ">
<%  if (v.size() > 0) {%>
<div style="padding-top: 15px;">
    <%
      for (int i = 0; i < v.size(); i++) {
          Beans.Ban kv = (Beans.Ban) v.elementAt(i);%>
    <div style=" width: 90px; float: left; margin-left: 20px;"><%=Ban_Model.LayTenKV(kv.getMaKV(), langid)%></div>
    <div class="seatt" style="float: left; width: 80%;">
        <%
                        Vector dsban = new Vector();
                        PhieuDatMA_Model p = new PhieuDatMA_Model();
                        dsban = p.LayDSBan(kv.getMaKV());
                        for (int j = 0; j < dsban.size(); j++) {
                        Beans.Ban b = (Beans.Ban) dsban.elementAt(j);%>
        <a href="#" class="available" name="<%=b.getMaBan()%>" lang="<%=msgright%>" onclick="DetailDMA(this.name, this.lang)"><center><%=b.getTenBan()%></center></a>
        <%  }%>
    </div><br/>
    <%  }%>
</div>
<%  }%>
</div>
<div id="DMA" class="bloc" style=" margin-top: 15px;">
</div>
</div>
    </body>
</html>


